<?php
$bookingItem = new BWInputValue($bookingId);
$cartTable = new BWCart();
$bookingRow = new BTreeList($bookingItem);
$cartRow = $cartTable->getListById($cartId);

$venderName = $bookingRow->getItem('venderName')->value;
$courtDisplayName = $bookingRow->getItem('courtDisplayName')->value;
$courtAddress = $bookingRow->getItem('courtAddress')->value;
$courtName = $bookingRow->getItem('courtName')->value;
$startTime = $bookingRow->getItem('startTime')->value;
$endTime = $bookingRow->getItem('endTime')->value;
if($bookingRow->getItem('paidTime')){
    $paidTime =$bookingRow->getItem('paidTime')->value; 
}
$buyerId = Blyn::app()->getCurrentUser()->getId();
if($cartRow->getItem('buyerId'))
    $buyerId = $cartRow->getItem('buyerId')->value;
$price = $cartRow->getItem('price')->value;
$quantity = $cartRow->getItem('quantity')->value;
?>
<?php
$cs = Yii::app()->getClientScript();
$cs->registerCSSFile(Yii::app()->request->baseUrl . '/css/mobile/booking_find_1.css');
?>
<meta name="viewport" content="initial-scale=1, width=device-width, maximum-scale=1, user-scalable=no">
<meta name="viewport" content="initial-scale=1.0,user-scalable=no,maximum-scale=1" media="(device-height: 568px)">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-touch-fullscreen" content="yes">
<meta name="full-screen" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<header class="navbar">
                <div class="nav-wrap-left">
<!--                    <a class="react back" href="#"><i class="text-icon icon-back"></i></a>-->
                </div>
            <h1 class="nav-header">订单详情</h1>

        <?php
        $screen = Blyn::app()->getUIManager()->getCurrentScreen();
        $wxControl = $screen->getChildControl('BUIWXControl_1');
        $wxControl->renderView('booking_navigation', array());
        ?>
        </header>
<style>
.album {
    height: 3.9rem;
    position: relative;
    overflow: hidden;
}

.album img {
    width: 100%;
    min-height: 100%;
    -webkit-transform: translateY(-50%);
    -ms-transform: translateY(-50%);
    -moz-transform: translateY(-50%);
    top: 50%;
    position: relative;
}

.album .desc {
    position: absolute;
    bottom: 0;
    width: 100%;
    color: white;
    text-align: center;
    height: .56rem;
    line-height: .56rem;
    font-size: .24rem;
    background: rgba(0, 0, 0, .5);
}

ul.ul {
    list-style-type: initial;
    padding-left: .4rem;
}

ul.ul li {
    font-size: .3rem;
    margin: .1rem 0;
    line-height: 1.5;
}

    /*///*/
#deal-detail .buy-price {
    color: #999;
    position: relative;
}

.buy-price .price {
    vertical-align: text-top;
}

.buy-price strong {
    font-size: .66rem;
}

.buy-price space {
    width: .16rem;
}

.buy-price .buy-btn {
    position: absolute;
    right: .2rem;
    top: .21rem;
    //width: 2.6rem;
}

.buy-desc h1 {
    font-size: .36rem;
    margin: 0;
    margin-bottom: .22rem;
    color: #000;
}

.buy-desc p {
    margin: 0;
    color: #666;
}
.courtName{
    font-family: inherit;font-weight: bold;padding: 5px;
}
.startName{
    font-family: inherit;
font-weight: bold;padding: 5px;
}
.endName{
    font-family: inherit;
font-weight: bold;padding: 5px;
}
.price{
    font-family: inherit;
font-weight: bold;padding: 5px;
}
.quantity{
    font-family: inherit;
font-weight: bold;padding: 5px;
}
</style>
<div id="deal" class="deal">
<div class="list">
    
    <dl class="list list-in">
        
        <dd class="dd-padding buy-desc">
                <ul class="ul">
                    <li>场地名称:<span  class="courtName"><?php echo $courtDisplayName; ?></span></li>
                    <li>开始时间:<span class="startName"><?php echo date('Y.m.d-G:i:s', $startTime); ?></span></li>
                    <li>结束时间:<span class="endName"><?php echo date('Y.m.d-G:i:s', $endTime); ?></span></li>
                    <li>价格:<span class="price"><?php echo $price; ?>元</span></li>
                    <li>地点:<span class="quantity"><?php echo $courtAddress; ?></span></li>
                    <li>我的会员卡号:<span class="quantity"><?php echo $buyerId; ?></span></li>
                </ul>
            <?php
            if($state == "paid"){
                 $myUrl = $wxControl->getLinkUrl(array('name' => '我的订单记录', 'id' => 'showMyBookingList_1'), array('paymentStatus' => 'paid'));
            }elseif ($state == "unpaid") {
                 $myUrl = $wxControl->getLinkUrl(array('name' => '我的预定记录', 'id' => 'showMyBookingList_1'), array('paymentStatus' => 'unpaid'));
                }
           
            ?>
            <a href="<?php echo $myUrl;?>" class="btn">确定</a>
                    <?php
//        echo $control->getLink(array('name' => '确认', 'id' => 'cancelBookingNow_1'), array(
//            'cartId' => $cartId,
//            'bookingId' => $bookingId,
//            'htmlOptions' => array('class' => 'btn')));

    ?>

        </dd>
    </dl>
</div>


</div>

<footer>
        <div class="footer-copyright">
            <div class="hr"></div>
            <span class="footer-copyright-text">
			Copyright © 2014 billyn.net </span>
        </div>
    </footer>
